Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update explainer to include feature detection and new syntax #173

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

timcappalli
Copy link
Member

Closes #170

Copy link
Contributor

@OR13 OR13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if adding fetch would improve this example.

@timcappalli
Copy link
Member Author

I wonder if adding fetch would improve this example.

the full example that includes fetch is linked below the code snippet.

async function requestCredential() {

// Check for Digital Credentials API support
if (typeof window.DigitalCredential !== 'undefined') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe return early here? e.g.

Suggested change
if (typeof window.DigitalCredential !== 'undefined') {
if (typeof window.DigitalCredential !== 'undefined') {
// API not supported, return undefined.
return;
}

Copy link
Collaborator

@samuelgoto samuelgoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@timcappalli timcappalli merged commit 3d86917 into main Oct 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update example to show feature detection
3 participants